//===----------------------------------------------------------------------===//
//
// This source file is part of the Soto for AWS open source project
//
// Copyright (c) 2017-2024 the Soto project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of Soto project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//

// THIS FILE IS AUTOMATICALLY GENERATED by https://github.com/soto-project/soto-codegenerator.
// DO NOT EDIT.

#if canImport(FoundationEssentials)
import FoundationEssentials
#else
import Foundation
#endif
@_exported import SotoCore

/// Service object for interacting with AWS ARCRegionSwitch service.
///
/// Amazon Application Recovery Controller (ARC) Region switch helps you to quickly and reliably shift traffic away from an impaired Amazon Web Services Region to a healthy Region. With Region switch, you can create plans that define the steps to shift traffic for your application from one Amazon Web Services Region to another. You can test your plans in practice mode before using them in a real recovery scenario. Region switch provides a structured approach to multi-Region failover, helping you to meet your recovery time objectives (RTOs) and maintain business continuity during regional disruptions. For more information, see Region switch in ARC in the Amazon Application Recovery Controller User Guide.
public struct ARCRegionSwitch: AWSService {
    // MARK: Member variables

    /// Client used for communication with AWS
    public let client: AWSClient
    /// Service configuration
    public let config: AWSServiceConfig

    // MARK: Initialization

    /// Initialize the ARCRegionSwitch client
    /// - parameters:
    ///     - client: AWSClient used to process requests
    ///     - region: Region of server you want to communicate with. This will override the partition parameter.
    ///     - partition: AWS partition where service resides, standard (.aws), china (.awscn), government (.awsusgov).
    ///     - endpoint: Custom endpoint URL to use instead of standard AWS servers
    ///     - middleware: Middleware chain used to edit requests before they are sent and responses before they are decoded 
    ///     - timeout: Timeout value for HTTP requests
    ///     - byteBufferAllocator: Allocator for ByteBuffers
    ///     - options: Service options
    public init(
        client: AWSClient,
        region: SotoCore.Region? = nil,
        partition: AWSPartition = .aws,
        endpoint: String? = nil,
        middleware: AWSMiddlewareProtocol? = nil,
        timeout: TimeAmount? = nil,
        byteBufferAllocator: ByteBufferAllocator = ByteBufferAllocator(),
        options: AWSServiceConfig.Options = []
    ) {
        self.client = client
        self.config = AWSServiceConfig(
            region: region,
            partition: region?.partition ?? partition,
            amzTarget: "ArcRegionSwitch",
            serviceName: "ARCRegionSwitch",
            serviceIdentifier: "arc-region-switch",
            serviceProtocol: .json(version: "1.0"),
            apiVersion: "2022-07-26",
            endpoint: endpoint,
            errorType: ARCRegionSwitchErrorType.self,
            middleware: middleware,
            timeout: timeout,
            byteBufferAllocator: byteBufferAllocator,
            options: options
        )
    }





    // MARK: API Calls

    /// Approves a step in a plan execution that requires manual approval. When you create a plan, you can include approval steps that require manual intervention before the execution can proceed. This operation allows you to provide that approval. You must specify the plan ARN, execution ID, step name, and approval status. You can also provide an optional comment explaining the approval decision.
    @Sendable
    @inlinable
    public func approvePlanExecutionStep(_ input: ApprovePlanExecutionStepRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ApprovePlanExecutionStepResponse {
        try await self.client.execute(
            operation: "ApprovePlanExecutionStep", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Approves a step in a plan execution that requires manual approval. When you create a plan, you can include approval steps that require manual intervention before the execution can proceed. This operation allows you to provide that approval. You must specify the plan ARN, execution ID, step name, and approval status. You can also provide an optional comment explaining the approval decision.
    ///
    /// Parameters:
    ///   - approval: The status of approval for a plan execution step.
    ///   - comment: A comment that you can enter about a plan execution.
    ///   - executionId: The execution identifier of a plan execution.
    ///   - planArn: The Amazon Resource Name (ARN) of the plan.
    ///   - stepName: The name of a step in a plan execution.
    ///   - logger: Logger use during operation
    @inlinable
    public func approvePlanExecutionStep(
        approval: Approval,
        comment: String? = nil,
        executionId: String,
        planArn: String,
        stepName: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ApprovePlanExecutionStepResponse {
        let input = ApprovePlanExecutionStepRequest(
            approval: approval, 
            comment: comment, 
            executionId: executionId, 
            planArn: planArn, 
            stepName: stepName
        )
        return try await self.approvePlanExecutionStep(input, logger: logger)
    }

    /// Cancels an in-progress plan execution. This operation stops the execution of the plan and prevents any further steps from being processed. You must specify the plan ARN and execution ID. You can also provide an optional comment explaining why the execution was canceled.
    @Sendable
    @inlinable
    public func cancelPlanExecution(_ input: CancelPlanExecutionRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> CancelPlanExecutionResponse {
        try await self.client.execute(
            operation: "CancelPlanExecution", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Cancels an in-progress plan execution. This operation stops the execution of the plan and prevents any further steps from being processed. You must specify the plan ARN and execution ID. You can also provide an optional comment explaining why the execution was canceled.
    ///
    /// Parameters:
    ///   - comment: A comment that you can enter about canceling a plan execution step.
    ///   - executionId: The execution identifier of a plan execution.
    ///   - planArn: The Amazon Resource Name (ARN) of the plan.
    ///   - logger: Logger use during operation
    @inlinable
    public func cancelPlanExecution(
        comment: String? = nil,
        executionId: String,
        planArn: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> CancelPlanExecutionResponse {
        let input = CancelPlanExecutionRequest(
            comment: comment, 
            executionId: executionId, 
            planArn: planArn
        )
        return try await self.cancelPlanExecution(input, logger: logger)
    }

    /// Creates a new Region switch plan. A plan defines the steps required to shift traffic from one Amazon Web Services Region to another. You must specify a name for the plan, the primary Region, and at least one additional Region. You can also provide a description, execution role, recovery time objective, associated alarms, triggers, and workflows that define the steps to execute during a Region switch.
    @Sendable
    @inlinable
    public func createPlan(_ input: CreatePlanRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> CreatePlanResponse {
        try await self.client.execute(
            operation: "CreatePlan", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Creates a new Region switch plan. A plan defines the steps required to shift traffic from one Amazon Web Services Region to another. You must specify a name for the plan, the primary Region, and at least one additional Region. You can also provide a description, execution role, recovery time objective, associated alarms, triggers, and workflows that define the steps to execute during a Region switch.
    ///
    /// Parameters:
    ///   - associatedAlarms: The alarms associated with a Region switch plan.
    ///   - description: The description of a Region switch plan.
    ///   - executionRole: An execution role is a way to categorize a Region switch plan.
    ///   - name: The name of a Region switch plan.
    ///   - primaryRegion: The primary Amazon Web Services Region for the application. This is the Region where the application normally runs before any Region switch occurs.
    ///   - recoveryApproach: The recovery approach for a Region switch plan, which can be active/active (activeActive) or active/passive (activePassive).
    ///   - recoveryTimeObjectiveMinutes: Optionally, you can specify an recovery time objective for a Region switch plan, in minutes.
    ///   - regions: An array that specifies the Amazon Web Services Regions for a Region switch plan. Specify two Regions.
    ///   - tags: The tags to apply to the Region switch plan.
    ///   - triggers: The triggers associated with a Region switch plan.
    ///   - workflows: An array of workflows included in a Region switch plan.
    ///   - logger: Logger use during operation
    @inlinable
    public func createPlan(
        associatedAlarms: [String: AssociatedAlarm]? = nil,
        description: String? = nil,
        executionRole: String,
        name: String,
        primaryRegion: String? = nil,
        recoveryApproach: RecoveryApproach,
        recoveryTimeObjectiveMinutes: Int? = nil,
        regions: [String],
        tags: [String: String]? = nil,
        triggers: [Trigger]? = nil,
        workflows: [Workflow],
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> CreatePlanResponse {
        let input = CreatePlanRequest(
            associatedAlarms: associatedAlarms, 
            description: description, 
            executionRole: executionRole, 
            name: name, 
            primaryRegion: primaryRegion, 
            recoveryApproach: recoveryApproach, 
            recoveryTimeObjectiveMinutes: recoveryTimeObjectiveMinutes, 
            regions: regions, 
            tags: tags, 
            triggers: triggers, 
            workflows: workflows
        )
        return try await self.createPlan(input, logger: logger)
    }

    /// Deletes a Region switch plan. You must specify the ARN of the plan to delete. You cannot delete a plan that has an active execution in progress.
    @Sendable
    @inlinable
    public func deletePlan(_ input: DeletePlanRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DeletePlanResponse {
        try await self.client.execute(
            operation: "DeletePlan", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Deletes a Region switch plan. You must specify the ARN of the plan to delete. You cannot delete a plan that has an active execution in progress.
    ///
    /// Parameters:
    ///   - arn: The Amazon Resource Name (ARN) of the plan.
    ///   - logger: Logger use during operation
    @inlinable
    public func deletePlan(
        arn: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DeletePlanResponse {
        let input = DeletePlanRequest(
            arn: arn
        )
        return try await self.deletePlan(input, logger: logger)
    }

    /// Retrieves detailed information about a Region switch plan. You must specify the ARN of the plan.
    @Sendable
    @inlinable
    public func getPlan(_ input: GetPlanRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> GetPlanResponse {
        try await self.client.execute(
            operation: "GetPlan", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Retrieves detailed information about a Region switch plan. You must specify the ARN of the plan.
    ///
    /// Parameters:
    ///   - arn: The Amazon Resource Name (ARN) of the plan.
    ///   - logger: Logger use during operation
    @inlinable
    public func getPlan(
        arn: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetPlanResponse {
        let input = GetPlanRequest(
            arn: arn
        )
        return try await self.getPlan(input, logger: logger)
    }

    /// Retrieves the evaluation status of a Region switch plan. The evaluation status provides information about the last time the plan was evaluated and any warnings or issues detected.
    @Sendable
    @inlinable
    public func getPlanEvaluationStatus(_ input: GetPlanEvaluationStatusRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> GetPlanEvaluationStatusResponse {
        try await self.client.execute(
            operation: "GetPlanEvaluationStatus", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Retrieves the evaluation status of a Region switch plan. The evaluation status provides information about the last time the plan was evaluated and any warnings or issues detected.
    ///
    /// Parameters:
    ///   - maxResults: The number of objects that you want to return with this call.
    ///   - nextToken: Specifies that you want to receive the next page of results. Valid only if you received a nextToken response in the previous request. If you did, it indicates that more output is available. Set this parameter to the value provided by the previous call's nextToken response to request the next page of results.
    ///   - planArn: The Amazon Resource Name (ARN) of the Region switch plan to retrieve evaluation status for.
    ///   - logger: Logger use during operation
    @inlinable
    public func getPlanEvaluationStatus(
        maxResults: Int? = nil,
        nextToken: String? = nil,
        planArn: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetPlanEvaluationStatusResponse {
        let input = GetPlanEvaluationStatusRequest(
            maxResults: maxResults, 
            nextToken: nextToken, 
            planArn: planArn
        )
        return try await self.getPlanEvaluationStatus(input, logger: logger)
    }

    /// Retrieves detailed information about a specific plan execution. You must specify the plan ARN and execution ID.
    @Sendable
    @inlinable
    public func getPlanExecution(_ input: GetPlanExecutionRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> GetPlanExecutionResponse {
        try await self.client.execute(
            operation: "GetPlanExecution", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Retrieves detailed information about a specific plan execution. You must specify the plan ARN and execution ID.
    ///
    /// Parameters:
    ///   - executionId: The execution identifier of a plan execution.
    ///   - maxResults: The number of objects that you want to return with this call.
    ///   - nextToken: Specifies that you want to receive the next page of results. Valid only if you received a nextToken response in the previous request. If you did, it indicates that more output is available. Set this parameter to the value provided by the previous call's nextToken response to request the next page of results.
    ///   - planArn: The Amazon Resource Name (ARN) of the plan with the execution to retrieve.
    ///   - logger: Logger use during operation
    @inlinable
    public func getPlanExecution(
        executionId: String,
        maxResults: Int? = nil,
        nextToken: String? = nil,
        planArn: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetPlanExecutionResponse {
        let input = GetPlanExecutionRequest(
            executionId: executionId, 
            maxResults: maxResults, 
            nextToken: nextToken, 
            planArn: planArn
        )
        return try await self.getPlanExecution(input, logger: logger)
    }

    /// Retrieves information about a Region switch plan in a specific Amazon Web Services Region. This operation is useful for getting Region-specific information about a plan.
    @Sendable
    @inlinable
    public func getPlanInRegion(_ input: GetPlanInRegionRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> GetPlanInRegionResponse {
        try await self.client.execute(
            operation: "GetPlanInRegion", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Retrieves information about a Region switch plan in a specific Amazon Web Services Region. This operation is useful for getting Region-specific information about a plan.
    ///
    /// Parameters:
    ///   - arn: The Amazon Resource Name (ARN) of the plan in Region.
    ///   - logger: Logger use during operation
    @inlinable
    public func getPlanInRegion(
        arn: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetPlanInRegionResponse {
        let input = GetPlanInRegionRequest(
            arn: arn
        )
        return try await self.getPlanInRegion(input, logger: logger)
    }

    /// Lists the events that occurred during a plan execution. These events provide a detailed timeline of the execution process.
    @Sendable
    @inlinable
    public func listPlanExecutionEvents(_ input: ListPlanExecutionEventsRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListPlanExecutionEventsResponse {
        try await self.client.execute(
            operation: "ListPlanExecutionEvents", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Lists the events that occurred during a plan execution. These events provide a detailed timeline of the execution process.
    ///
    /// Parameters:
    ///   - executionId: The execution identifier of a plan execution.
    ///   - maxResults: The number of objects that you want to return with this call.
    ///   - name: The name of the plan execution event.
    ///   - nextToken: Specifies that you want to receive the next page of results. Valid only if you received a nextToken response in the previous request. If you did, it indicates that more output is available. Set this parameter to the value provided by the previous call's nextToken response to request the next page of results.
    ///   - planArn: The Amazon Resource Name (ARN) of the plan.
    ///   - logger: Logger use during operation
    @inlinable
    public func listPlanExecutionEvents(
        executionId: String,
        maxResults: Int? = nil,
        name: String? = nil,
        nextToken: String? = nil,
        planArn: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListPlanExecutionEventsResponse {
        let input = ListPlanExecutionEventsRequest(
            executionId: executionId, 
            maxResults: maxResults, 
            name: name, 
            nextToken: nextToken, 
            planArn: planArn
        )
        return try await self.listPlanExecutionEvents(input, logger: logger)
    }

    /// Lists the executions of a Region switch plan. This operation returns information about both current and historical executions.
    @Sendable
    @inlinable
    public func listPlanExecutions(_ input: ListPlanExecutionsRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListPlanExecutionsResponse {
        try await self.client.execute(
            operation: "ListPlanExecutions", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Lists the executions of a Region switch plan. This operation returns information about both current and historical executions.
    ///
    /// Parameters:
    ///   - maxResults: The number of objects that you want to return with this call.
    ///   - nextToken: Specifies that you want to receive the next page of results. Valid only if you received a nextToken response in the previous request. If you did, it indicates that more output is available. Set this parameter to the value provided by the previous call's nextToken response to request the next page of results.
    ///   - planArn: The ARN for the plan.
    ///   - state: The state of the plan execution. For example, the plan execution might be In Progress.
    ///   - logger: Logger use during operation
    @inlinable
    public func listPlanExecutions(
        maxResults: Int? = nil,
        nextToken: String? = nil,
        planArn: String,
        state: ExecutionState? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListPlanExecutionsResponse {
        let input = ListPlanExecutionsRequest(
            maxResults: maxResults, 
            nextToken: nextToken, 
            planArn: planArn, 
            state: state
        )
        return try await self.listPlanExecutions(input, logger: logger)
    }

    /// Lists all Region switch plans in your Amazon Web Services account.
    @Sendable
    @inlinable
    public func listPlans(_ input: ListPlansRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListPlansResponse {
        try await self.client.execute(
            operation: "ListPlans", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Lists all Region switch plans in your Amazon Web Services account.
    ///
    /// Parameters:
    ///   - maxResults: The number of objects that you want to return with this call.
    ///   - nextToken: Specifies that you want to receive the next page of results. Valid only if you received a nextToken response in the previous request. If you did, it indicates that more output is available. Set this parameter to the value provided by the previous call's nextToken response to request the next page of results.
    ///   - logger: Logger use during operation
    @inlinable
    public func listPlans(
        maxResults: Int? = nil,
        nextToken: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListPlansResponse {
        let input = ListPlansRequest(
            maxResults: maxResults, 
            nextToken: nextToken
        )
        return try await self.listPlans(input, logger: logger)
    }

    /// Lists all Region switch plans in your Amazon Web Services account that are available in the current Amazon Web Services Region.
    @Sendable
    @inlinable
    public func listPlansInRegion(_ input: ListPlansInRegionRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListPlansInRegionResponse {
        try await self.client.execute(
            operation: "ListPlansInRegion", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Lists all Region switch plans in your Amazon Web Services account that are available in the current Amazon Web Services Region.
    ///
    /// Parameters:
    ///   - maxResults: The number of objects that you want to return with this call.
    ///   - nextToken: Specifies that you want to receive the next page of results. Valid only if you received a nextToken response in the previous request. If you did, it indicates that more output is available. Set this parameter to the value provided by the previous call's nextToken response to request the next page of results.
    ///   - logger: Logger use during operation
    @inlinable
    public func listPlansInRegion(
        maxResults: Int? = nil,
        nextToken: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListPlansInRegionResponse {
        let input = ListPlansInRegionRequest(
            maxResults: maxResults, 
            nextToken: nextToken
        )
        return try await self.listPlansInRegion(input, logger: logger)
    }

    /// List the Amazon Route 53 health checks.
    @Sendable
    @inlinable
    public func listRoute53HealthChecks(_ input: ListRoute53HealthChecksRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListRoute53HealthChecksResponse {
        try await self.client.execute(
            operation: "ListRoute53HealthChecks", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// List the Amazon Route 53 health checks.
    ///
    /// Parameters:
    ///   - arn: The Amazon Resource Name (ARN) of the Amazon Route 53 health check request.
    ///   - hostedZoneId: The hosted zone ID for the health checks.
    ///   - maxResults: The number of objects that you want to return with this call.
    ///   - nextToken: Specifies that you want to receive the next page of results. Valid only if you received a nextToken response in the previous request. If you did, it indicates that more output is available. Set this parameter to the value provided by the previous call's nextToken response to request the next page of results.
    ///   - recordName: The record name for the health checks.
    ///   - logger: Logger use during operation
    @inlinable
    public func listRoute53HealthChecks(
        arn: String,
        hostedZoneId: String? = nil,
        maxResults: Int? = nil,
        nextToken: String? = nil,
        recordName: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListRoute53HealthChecksResponse {
        let input = ListRoute53HealthChecksRequest(
            arn: arn, 
            hostedZoneId: hostedZoneId, 
            maxResults: maxResults, 
            nextToken: nextToken, 
            recordName: recordName
        )
        return try await self.listRoute53HealthChecks(input, logger: logger)
    }

    /// Lists the tags attached to a Region switch resource.
    @Sendable
    @inlinable
    public func listTagsForResource(_ input: ListTagsForResourceRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListTagsForResourceResponse {
        try await self.client.execute(
            operation: "ListTagsForResource", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Lists the tags attached to a Region switch resource.
    ///
    /// Parameters:
    ///   - arn: The Amazon Resource Name (ARN) of the resource.
    ///   - logger: Logger use during operation
    @inlinable
    public func listTagsForResource(
        arn: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListTagsForResourceResponse {
        let input = ListTagsForResourceRequest(
            arn: arn
        )
        return try await self.listTagsForResource(input, logger: logger)
    }

    /// Starts the execution of a Region switch plan. You can execute a plan in either PRACTICE or RECOVERY mode. In PRACTICE mode, the execution simulates the steps without making actual changes to your application's traffic routing. In RECOVERY mode, the execution performs actual changes to shift traffic between Regions.
    @Sendable
    @inlinable
    public func startPlanExecution(_ input: StartPlanExecutionRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> StartPlanExecutionResponse {
        try await self.client.execute(
            operation: "StartPlanExecution", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Starts the execution of a Region switch plan. You can execute a plan in either PRACTICE or RECOVERY mode. In PRACTICE mode, the execution simulates the steps without making actual changes to your application's traffic routing. In RECOVERY mode, the execution performs actual changes to shift traffic between Regions.
    ///
    /// Parameters:
    ///   - action: The action to perform. Valid values are ACTIVATE (to shift traffic to the target Region) or DEACTIVATE (to shift traffic away from the target Region).
    ///   - comment: An optional comment explaining why the plan execution is being started.
    ///   - latestVersion: A boolean value indicating whether to use the latest version of the plan. If set to false, you must specify a specific version.
    ///   - mode: The plan execution mode. Valid values are Practice, for testing without making actual changes, or Recovery, for actual traffic shifting and application recovery.
    ///   - planArn: The Amazon Resource Name (ARN) of the plan to execute.
    ///   - targetRegion: The Amazon Web Services Region to target with this execution. This is the Region that traffic will be shifted to or from, depending on the action.
    ///   - logger: Logger use during operation
    @inlinable
    public func startPlanExecution(
        action: ExecutionAction,
        comment: String? = nil,
        latestVersion: String? = nil,
        mode: ExecutionMode? = nil,
        planArn: String,
        targetRegion: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> StartPlanExecutionResponse {
        let input = StartPlanExecutionRequest(
            action: action, 
            comment: comment, 
            latestVersion: latestVersion, 
            mode: mode, 
            planArn: planArn, 
            targetRegion: targetRegion
        )
        return try await self.startPlanExecution(input, logger: logger)
    }

    /// Adds or updates tags for a Region switch resource. You can assign metadata to your resources in the form of tags, which are key-value pairs.
    @Sendable
    @inlinable
    public func tagResource(_ input: TagResourceRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> TagResourceResponse {
        try await self.client.execute(
            operation: "TagResource", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Adds or updates tags for a Region switch resource. You can assign metadata to your resources in the form of tags, which are key-value pairs.
    ///
    /// Parameters:
    ///   - arn: The Amazon Resource Name (ARN) for a tag that you add to a resource.
    ///   - tags: Tags that you add to a resource. You can add a maximum of 50 tags in Region switch.
    ///   - logger: Logger use during operation
    @inlinable
    public func tagResource(
        arn: String,
        tags: [String: String],
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> TagResourceResponse {
        let input = TagResourceRequest(
            arn: arn, 
            tags: tags
        )
        return try await self.tagResource(input, logger: logger)
    }

    /// Removes tags from a Region switch resource.
    @Sendable
    @inlinable
    public func untagResource(_ input: UntagResourceRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> UntagResourceResponse {
        try await self.client.execute(
            operation: "UntagResource", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Removes tags from a Region switch resource.
    ///
    /// Parameters:
    ///   - arn: The Amazon Resource Name (ARN) for a tag you remove a resource from.
    ///   - resourceTagKeys: Tag keys that you remove from a resource.
    ///   - logger: Logger use during operation
    @inlinable
    public func untagResource(
        arn: String,
        resourceTagKeys: [String],
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> UntagResourceResponse {
        let input = UntagResourceRequest(
            arn: arn, 
            resourceTagKeys: resourceTagKeys
        )
        return try await self.untagResource(input, logger: logger)
    }

    /// Updates an existing Region switch plan. You can modify the plan's description, workflows, execution role, recovery time objective, associated alarms, and triggers.
    @Sendable
    @inlinable
    public func updatePlan(_ input: UpdatePlanRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> UpdatePlanResponse {
        try await self.client.execute(
            operation: "UpdatePlan", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Updates an existing Region switch plan. You can modify the plan's description, workflows, execution role, recovery time objective, associated alarms, and triggers.
    ///
    /// Parameters:
    ///   - arn: The Amazon Resource Name (ARN) of the plan.
    ///   - associatedAlarms: The updated CloudWatch alarms associated with the plan.
    ///   - description: The updated description for the Region switch plan.
    ///   - executionRole: The updated IAM role ARN that grants Region switch the permissions needed to execute the plan steps.
    ///   - recoveryTimeObjectiveMinutes: The updated target recovery time objective (RTO) in minutes for the plan.
    ///   - triggers: The updated conditions that can automatically trigger the execution of the plan.
    ///   - workflows: The updated workflows for the Region switch plan.
    ///   - logger: Logger use during operation
    @inlinable
    public func updatePlan(
        arn: String,
        associatedAlarms: [String: AssociatedAlarm]? = nil,
        description: String? = nil,
        executionRole: String,
        recoveryTimeObjectiveMinutes: Int? = nil,
        triggers: [Trigger]? = nil,
        workflows: [Workflow],
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> UpdatePlanResponse {
        let input = UpdatePlanRequest(
            arn: arn, 
            associatedAlarms: associatedAlarms, 
            description: description, 
            executionRole: executionRole, 
            recoveryTimeObjectiveMinutes: recoveryTimeObjectiveMinutes, 
            triggers: triggers, 
            workflows: workflows
        )
        return try await self.updatePlan(input, logger: logger)
    }

    /// Updates an in-progress plan execution. This operation allows you to modify certain aspects of the execution, such as adding a comment or changing the action.
    @Sendable
    @inlinable
    public func updatePlanExecution(_ input: UpdatePlanExecutionRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> UpdatePlanExecutionResponse {
        try await self.client.execute(
            operation: "UpdatePlanExecution", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Updates an in-progress plan execution. This operation allows you to modify certain aspects of the execution, such as adding a comment or changing the action.
    ///
    /// Parameters:
    ///   - action: The action specified for a plan execution, for example, Switch to Graceful or Pause.
    ///   - comment: An optional comment about the plan execution.
    ///   - executionId: The execution identifier of a plan execution.
    ///   - planArn: The Amazon Resource Name (ARN) of the plan with the execution to update.
    ///   - logger: Logger use during operation
    @inlinable
    public func updatePlanExecution(
        action: UpdatePlanExecutionAction,
        comment: String? = nil,
        executionId: String,
        planArn: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> UpdatePlanExecutionResponse {
        let input = UpdatePlanExecutionRequest(
            action: action, 
            comment: comment, 
            executionId: executionId, 
            planArn: planArn
        )
        return try await self.updatePlanExecution(input, logger: logger)
    }

    /// Updates a specific step in an in-progress plan execution. This operation allows you to modify the step's comment or action.
    @Sendable
    @inlinable
    public func updatePlanExecutionStep(_ input: UpdatePlanExecutionStepRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> UpdatePlanExecutionStepResponse {
        try await self.client.execute(
            operation: "UpdatePlanExecutionStep", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Updates a specific step in an in-progress plan execution. This operation allows you to modify the step's comment or action.
    ///
    /// Parameters:
    ///   - actionToTake: The updated action to take for the step. This can be used to skip or retry a step.
    ///   - comment: An optional comment about the plan execution.
    ///   - executionId: The unique identifier of the plan execution containing the step to update.
    ///   - planArn: The Amazon Resource Name (ARN) of the plan containing the execution step to update.
    ///   - stepName: The name of the execution step to update.
    ///   - logger: Logger use during operation
    @inlinable
    public func updatePlanExecutionStep(
        actionToTake: UpdatePlanExecutionStepAction,
        comment: String,
        executionId: String,
        planArn: String,
        stepName: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> UpdatePlanExecutionStepResponse {
        let input = UpdatePlanExecutionStepRequest(
            actionToTake: actionToTake, 
            comment: comment, 
            executionId: executionId, 
            planArn: planArn, 
            stepName: stepName
        )
        return try await self.updatePlanExecutionStep(input, logger: logger)
    }
}

extension ARCRegionSwitch {
    /// Initializer required by `AWSService.with(middlewares:timeout:byteBufferAllocator:options)`. You are not able to use this initializer directly as there are not public
    /// initializers for `AWSServiceConfig.Patch`. Please use `AWSService.with(middlewares:timeout:byteBufferAllocator:options)` instead.
    public init(from: ARCRegionSwitch, patch: AWSServiceConfig.Patch) {
        self.client = from.client
        self.config = from.config.with(patch: patch)
    }
}

// MARK: Paginators

@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
extension ARCRegionSwitch {
    /// Return PaginatorSequence for operation ``getPlanEvaluationStatus(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func getPlanEvaluationStatusPaginator(
        _ input: GetPlanEvaluationStatusRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<GetPlanEvaluationStatusRequest, GetPlanEvaluationStatusResponse> {
        return .init(
            input: input,
            command: self.getPlanEvaluationStatus,
            inputKey: \GetPlanEvaluationStatusRequest.nextToken,
            outputKey: \GetPlanEvaluationStatusResponse.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``getPlanEvaluationStatus(_:logger:)``.
    ///
    /// - Parameters:
    ///   - maxResults: The number of objects that you want to return with this call.
    ///   - planArn: The Amazon Resource Name (ARN) of the Region switch plan to retrieve evaluation status for.
    ///   - logger: Logger used for logging
    @inlinable
    public func getPlanEvaluationStatusPaginator(
        maxResults: Int? = nil,
        planArn: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<GetPlanEvaluationStatusRequest, GetPlanEvaluationStatusResponse> {
        let input = GetPlanEvaluationStatusRequest(
            maxResults: maxResults, 
            planArn: planArn
        )
        return self.getPlanEvaluationStatusPaginator(input, logger: logger)
    }

    /// Return PaginatorSequence for operation ``getPlanExecution(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func getPlanExecutionPaginator(
        _ input: GetPlanExecutionRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<GetPlanExecutionRequest, GetPlanExecutionResponse> {
        return .init(
            input: input,
            command: self.getPlanExecution,
            inputKey: \GetPlanExecutionRequest.nextToken,
            outputKey: \GetPlanExecutionResponse.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``getPlanExecution(_:logger:)``.
    ///
    /// - Parameters:
    ///   - executionId: The execution identifier of a plan execution.
    ///   - maxResults: The number of objects that you want to return with this call.
    ///   - planArn: The Amazon Resource Name (ARN) of the plan with the execution to retrieve.
    ///   - logger: Logger used for logging
    @inlinable
    public func getPlanExecutionPaginator(
        executionId: String,
        maxResults: Int? = nil,
        planArn: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<GetPlanExecutionRequest, GetPlanExecutionResponse> {
        let input = GetPlanExecutionRequest(
            executionId: executionId, 
            maxResults: maxResults, 
            planArn: planArn
        )
        return self.getPlanExecutionPaginator(input, logger: logger)
    }

    /// Return PaginatorSequence for operation ``listPlanExecutionEvents(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func listPlanExecutionEventsPaginator(
        _ input: ListPlanExecutionEventsRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<ListPlanExecutionEventsRequest, ListPlanExecutionEventsResponse> {
        return .init(
            input: input,
            command: self.listPlanExecutionEvents,
            inputKey: \ListPlanExecutionEventsRequest.nextToken,
            outputKey: \ListPlanExecutionEventsResponse.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``listPlanExecutionEvents(_:logger:)``.
    ///
    /// - Parameters:
    ///   - executionId: The execution identifier of a plan execution.
    ///   - maxResults: The number of objects that you want to return with this call.
    ///   - name: The name of the plan execution event.
    ///   - planArn: The Amazon Resource Name (ARN) of the plan.
    ///   - logger: Logger used for logging
    @inlinable
    public func listPlanExecutionEventsPaginator(
        executionId: String,
        maxResults: Int? = nil,
        name: String? = nil,
        planArn: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<ListPlanExecutionEventsRequest, ListPlanExecutionEventsResponse> {
        let input = ListPlanExecutionEventsRequest(
            executionId: executionId, 
            maxResults: maxResults, 
            name: name, 
            planArn: planArn
        )
        return self.listPlanExecutionEventsPaginator(input, logger: logger)
    }

    /// Return PaginatorSequence for operation ``listPlanExecutions(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func listPlanExecutionsPaginator(
        _ input: ListPlanExecutionsRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<ListPlanExecutionsRequest, ListPlanExecutionsResponse> {
        return .init(
            input: input,
            command: self.listPlanExecutions,
            inputKey: \ListPlanExecutionsRequest.nextToken,
            outputKey: \ListPlanExecutionsResponse.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``listPlanExecutions(_:logger:)``.
    ///
    /// - Parameters:
    ///   - maxResults: The number of objects that you want to return with this call.
    ///   - planArn: The ARN for the plan.
    ///   - state: The state of the plan execution. For example, the plan execution might be In Progress.
    ///   - logger: Logger used for logging
    @inlinable
    public func listPlanExecutionsPaginator(
        maxResults: Int? = nil,
        planArn: String,
        state: ExecutionState? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<ListPlanExecutionsRequest, ListPlanExecutionsResponse> {
        let input = ListPlanExecutionsRequest(
            maxResults: maxResults, 
            planArn: planArn, 
            state: state
        )
        return self.listPlanExecutionsPaginator(input, logger: logger)
    }

    /// Return PaginatorSequence for operation ``listPlans(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func listPlansPaginator(
        _ input: ListPlansRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<ListPlansRequest, ListPlansResponse> {
        return .init(
            input: input,
            command: self.listPlans,
            inputKey: \ListPlansRequest.nextToken,
            outputKey: \ListPlansResponse.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``listPlans(_:logger:)``.
    ///
    /// - Parameters:
    ///   - maxResults: The number of objects that you want to return with this call.
    ///   - logger: Logger used for logging
    @inlinable
    public func listPlansPaginator(
        maxResults: Int? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<ListPlansRequest, ListPlansResponse> {
        let input = ListPlansRequest(
            maxResults: maxResults
        )
        return self.listPlansPaginator(input, logger: logger)
    }

    /// Return PaginatorSequence for operation ``listPlansInRegion(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func listPlansInRegionPaginator(
        _ input: ListPlansInRegionRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<ListPlansInRegionRequest, ListPlansInRegionResponse> {
        return .init(
            input: input,
            command: self.listPlansInRegion,
            inputKey: \ListPlansInRegionRequest.nextToken,
            outputKey: \ListPlansInRegionResponse.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``listPlansInRegion(_:logger:)``.
    ///
    /// - Parameters:
    ///   - maxResults: The number of objects that you want to return with this call.
    ///   - logger: Logger used for logging
    @inlinable
    public func listPlansInRegionPaginator(
        maxResults: Int? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<ListPlansInRegionRequest, ListPlansInRegionResponse> {
        let input = ListPlansInRegionRequest(
            maxResults: maxResults
        )
        return self.listPlansInRegionPaginator(input, logger: logger)
    }

    /// Return PaginatorSequence for operation ``listRoute53HealthChecks(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func listRoute53HealthChecksPaginator(
        _ input: ListRoute53HealthChecksRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<ListRoute53HealthChecksRequest, ListRoute53HealthChecksResponse> {
        return .init(
            input: input,
            command: self.listRoute53HealthChecks,
            inputKey: \ListRoute53HealthChecksRequest.nextToken,
            outputKey: \ListRoute53HealthChecksResponse.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``listRoute53HealthChecks(_:logger:)``.
    ///
    /// - Parameters:
    ///   - arn: The Amazon Resource Name (ARN) of the Amazon Route 53 health check request.
    ///   - hostedZoneId: The hosted zone ID for the health checks.
    ///   - maxResults: The number of objects that you want to return with this call.
    ///   - recordName: The record name for the health checks.
    ///   - logger: Logger used for logging
    @inlinable
    public func listRoute53HealthChecksPaginator(
        arn: String,
        hostedZoneId: String? = nil,
        maxResults: Int? = nil,
        recordName: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<ListRoute53HealthChecksRequest, ListRoute53HealthChecksResponse> {
        let input = ListRoute53HealthChecksRequest(
            arn: arn, 
            hostedZoneId: hostedZoneId, 
            maxResults: maxResults, 
            recordName: recordName
        )
        return self.listRoute53HealthChecksPaginator(input, logger: logger)
    }
}

extension ARCRegionSwitch.GetPlanEvaluationStatusRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> ARCRegionSwitch.GetPlanEvaluationStatusRequest {
        return .init(
            maxResults: self.maxResults,
            nextToken: token,
            planArn: self.planArn
        )
    }
}

extension ARCRegionSwitch.GetPlanExecutionRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> ARCRegionSwitch.GetPlanExecutionRequest {
        return .init(
            executionId: self.executionId,
            maxResults: self.maxResults,
            nextToken: token,
            planArn: self.planArn
        )
    }
}

extension ARCRegionSwitch.ListPlanExecutionEventsRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> ARCRegionSwitch.ListPlanExecutionEventsRequest {
        return .init(
            executionId: self.executionId,
            maxResults: self.maxResults,
            name: self.name,
            nextToken: token,
            planArn: self.planArn
        )
    }
}

extension ARCRegionSwitch.ListPlanExecutionsRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> ARCRegionSwitch.ListPlanExecutionsRequest {
        return .init(
            maxResults: self.maxResults,
            nextToken: token,
            planArn: self.planArn,
            state: self.state
        )
    }
}

extension ARCRegionSwitch.ListPlansInRegionRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> ARCRegionSwitch.ListPlansInRegionRequest {
        return .init(
            maxResults: self.maxResults,
            nextToken: token
        )
    }
}

extension ARCRegionSwitch.ListPlansRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> ARCRegionSwitch.ListPlansRequest {
        return .init(
            maxResults: self.maxResults,
            nextToken: token
        )
    }
}

extension ARCRegionSwitch.ListRoute53HealthChecksRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> ARCRegionSwitch.ListRoute53HealthChecksRequest {
        return .init(
            arn: self.arn,
            hostedZoneId: self.hostedZoneId,
            maxResults: self.maxResults,
            nextToken: token,
            recordName: self.recordName
        )
    }
}

// MARK: Waiters

@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
extension ARCRegionSwitch {
    /// Waiter for operation ``getPlanEvaluationStatus(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func waitUntilPlanEvaluationStatusPassed(
        _ input: GetPlanEvaluationStatusRequest,
        maxWaitTime: TimeAmount? = nil,
        logger: Logger = AWSClient.loggingDisabled
    ) async throws {
        let waiter = AWSClient.Waiter<GetPlanEvaluationStatusRequest, _>(
            acceptors: [
                .init(state: .success, matcher: try! JMESPathMatcher("evaluationState", expected: "passed")),
                .init(state: .failure, matcher: try! JMESPathMatcher("evaluationState", expected: "actionRequired")),
                .init(state: .retry, matcher: try! JMESPathMatcher("evaluationState", expected: "pendingEvaluation")),
            ],
            minDelayTime: .seconds(30),
            command: self.getPlanEvaluationStatus
        )
        return try await self.client.waitUntil(input, waiter: waiter, maxWaitTime: maxWaitTime, logger: logger)
    }
    /// Waiter for operation ``getPlanEvaluationStatus(_:logger:)``.
    ///
    /// - Parameters:
    ///   - maxResults: The number of objects that you want to return with this call.
    ///   - nextToken: Specifies that you want to receive the next page of results. Valid only if you received a nextToken response in the previous request. If you did, it indicates that more output is available. Set this parameter to the value provided by the previous call's nextToken response to request the next page of results.
    ///   - planArn: The Amazon Resource Name (ARN) of the Region switch plan to retrieve evaluation status for.
    ///   - logger: Logger used for logging
    @inlinable
    public func waitUntilPlanEvaluationStatusPassed(
        maxResults: Int? = nil,
        nextToken: String? = nil,
        planArn: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws {
        let input = GetPlanEvaluationStatusRequest(
            maxResults: maxResults, 
            nextToken: nextToken, 
            planArn: planArn
        )
        try await self.waitUntilPlanEvaluationStatusPassed(input, logger: logger)
    }

    /// Waiter for operation ``getPlanExecution(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func waitUntilPlanExecutionCompleted(
        _ input: GetPlanExecutionRequest,
        maxWaitTime: TimeAmount? = nil,
        logger: Logger = AWSClient.loggingDisabled
    ) async throws {
        let waiter = AWSClient.Waiter<GetPlanExecutionRequest, _>(
            acceptors: [
                .init(state: .success, matcher: try! JMESPathMatcher("executionState", expected: "completed")),
                .init(state: .success, matcher: try! JMESPathMatcher("executionState", expected: "completedWithExceptions")),
                .init(state: .failure, matcher: try! JMESPathMatcher("executionState", expected: "failed")),
                .init(state: .failure, matcher: try! JMESPathMatcher("executionState", expected: "canceled")),
                .init(state: .failure, matcher: try! JMESPathMatcher("executionState", expected: "planExecutionTimedOut")),
            ],
            minDelayTime: .seconds(30),
            command: self.getPlanExecution
        )
        return try await self.client.waitUntil(input, waiter: waiter, maxWaitTime: maxWaitTime, logger: logger)
    }
    /// Waiter for operation ``getPlanExecution(_:logger:)``.
    ///
    /// - Parameters:
    ///   - executionId: The execution identifier of a plan execution.
    ///   - maxResults: The number of objects that you want to return with this call.
    ///   - nextToken: Specifies that you want to receive the next page of results. Valid only if you received a nextToken response in the previous request. If you did, it indicates that more output is available. Set this parameter to the value provided by the previous call's nextToken response to request the next page of results.
    ///   - planArn: The Amazon Resource Name (ARN) of the plan with the execution to retrieve.
    ///   - logger: Logger used for logging
    @inlinable
    public func waitUntilPlanExecutionCompleted(
        executionId: String,
        maxResults: Int? = nil,
        nextToken: String? = nil,
        planArn: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws {
        let input = GetPlanExecutionRequest(
            executionId: executionId, 
            maxResults: maxResults, 
            nextToken: nextToken, 
            planArn: planArn
        )
        try await self.waitUntilPlanExecutionCompleted(input, logger: logger)
    }
}
